package com.inossem.warehousestorage_inossem.activity.group_up_frame;

import android.app.Activity;
import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.inossem.loadandrefresh.PullToRefreshLayout;
import com.inossem.loadandrefresh.pullableview.PullableListView;
import com.inossem.warehousestorage_inossem.R;
import com.inossem.warehousestorage_inossem.adapter.groupUpFrame.GroupUpFrameGroupMaterialFragmentAdapter;

/**
 * 作者：wsy on 2018/1/24 15:27
 * <p>
 * 邮箱：445979770@qq.com
 */

public class GroupUpFrameGroupMaterialFragment extends Fragment {
    private PullToRefreshLayout refresh;

    private PullableListView upFrameList;

    private GroupUpFrameGroupMaterialFragmentAdapter adapter;
    protected  Activity mActivity;

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        mActivity = activity;
    }
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_group_up_frame_group_material, container, false);
        initView(view);
        initData();
        return view;
    }
    private void initView(View view){
        upFrameList = (PullableListView) view.findViewById(R.id.upFrameList);
        refresh = (PullToRefreshLayout) view.findViewById(R.id.upFrameRefresh);
    }
    private void initData(){
        upFrameList.setPullUpFlag(false);
        upFrameList.setPullDownFlag(false);
        addUpFrameListData(true);
    }
    private void addUpFrameListData(boolean flag){
        if (flag) {
            adapter = new GroupUpFrameGroupMaterialFragmentAdapter(mActivity , "");
            upFrameList.setAdapter(adapter);
        }
    }
}
